Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Find the totally balanced binary sequence for a given rank
ResourceFunction["CatalanUnrank"][n,rank] gives the totally balanced binary sequence with n ones and the given rank.  | 
Here is the number of totally balanced binary sequences with five 1's:
| In[1]:= | 
| Out[1]= | 
Use CatalanUnrank to find the 20th totally balanced binary sequence with five 1's:
| In[2]:= | 
| Out[2]= | 
Show all totally balanced binary sequences with five 1’s:
| In[3]:= | 
| Out[3]= | ![]()  | 
The first few balanced binary sequences of rank 40:
| In[4]:= | 
| Out[4]= | ![]()  | 
This work is licensed under a Creative Commons Attribution 4.0 International License